home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
pascal
/
online.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1991-09-17
|
1KB
|
29 lines
This function will return true if Printer 0 is online. If you want to
check a different printer number, add a Word parameter (b) and then
change the MOV DX, 00H to MOV DX, b. I haven't tried using a different
printer number but **theoretically** it should work.
I also admit to being a novice BASM user. So far this has worked on my
system returning the correct value for CheckOnLine based on the printer's
status, but don't trust my work. Try it out yourself and let me know if
I messed this up!
Function CheckOnline : Boolean; Assembler; {Requires TP 6.0 BASM}
ASM
MOV AH, 02H {Int 17, Service 2 for printer status}
MOV AL, 00H {just playing it safe, probably not needed}
MOV DX, 00H {printer 0}
INT 17H
MOV AL, 00H {set checkonline false}
TEST AH, 10H {if bit 4 is set z flag=0, if not z flag=1}
JZ @No {leave function false if z flag is set}
INC AL
@No:
END;
Don Bibb
CIS ID# 70244, 3236
8/24/91